<?php
$reciboCobranza['Familia']['Alumno']['nivel'] = '';
if($reciboCobranza['Familia']['Alumno']['nivel_id'] == 1 )
    $reciboCobranza['Familia']['Alumno']['nivel'] = 'I';
else if($reciboCobranza['Familia']['Alumno']['nivel_id'] == 2 )
    $reciboCobranza['Familia']['Alumno']['nivel'] = 'P';
else if($reciboCobranza['Familia']['Alumno']['nivel_id'] == 3 )
    $reciboCobranza['Familia']['Alumno']['nivel'] = 'S';
?>
<table width="450">
    <tr>
        <td colspan="3">&nbsp;</td>
        <td>&nbsp;<br/><br/><br/><br/><br/>SERIE <?php echo $reciboCobranza['ReciboCobranza']['serie'];?><br/>N.Rec. <?php echo $reciboCobranza['ReciboCobranza']['numero_documento'];?></td>
    </tr>
    <tr>
        <td colspan="3">ALUMNO</td>
        <td><?php echo $reciboCobranza['ReciboCobranza']['fecha'];?></td>
    </tr>
    <tr>
        <td><?php echo $reciboCobranza['Familia']['Alumno']['codigo'];?></td>
        <td colspan="3"><?php echo $reciboCobranza['ReciboCobranza']['nombre_cliente'];?>--><?php echo $reciboCobranza['Familia']['Alumno']['nivel'].$reciboCobranza['Familia']['Alumno']['grado_id'].$reciboCobranza['Familia']['Alumno']['seccion'];?></td>
    </tr>
    <tr>
        <td style="border-bottom: #000 dashed thin;border-top: #000 dashed thin;">AÑO</td>
        <td style="border-bottom: #000 dashed thin;border-top: #000 dashed thin;">CUENTA/DETALLE</td>
        <td style="border-bottom: #000 dashed thin;border-top: #000 dashed thin;">IMPORTE</td>
        <td style="border-bottom: #000 dashed thin;border-top: #000 dashed thin;">&nbsp;</td>
    </tr>
    <?php 
    foreach($reciboCobranza['ReciboCobranzaDetalle'] as $detalle){
        echo '<tr><td>'.$detalle['DocumentoReferencia']['ejercicio_id'].'</td>';
        echo '<td>'.$detalle['DocumentoReferencia']['observaciones'].'</td>';
        echo '<td>'.number_format($detalle['abono'], 2, '.', '').'</td>';
        echo '<td>'.(($detalle['cancela']==1)?'PAGO TOTAL':'').'</td></tr>';    
    }
    ?>
    <tr>
        <td colspan="2" align="right" style="border-top: #000 dashed thin;">TOTAL A PAGAR S/. </td>        
        <td style="border-top: #000 dashed thin;"><?php echo number_format($reciboCobranza['ReciboCobranza']['monto_recibido'], 2, '.', '');?></td>
        <td style="border-top: #000 dashed thin;">&nbsp;</td>
    </tr>
    <tr>
        <td colspan="4">Son: <?php echo $reciboCobranza['ReciboCobranza']['texto'];?></td>
    </tr>
    <tr>
        <td colspan="4"><?php echo date("d-m-Y H:i:s");?></td>
    </tr>
</table>
<script type="text/javascript">
$(function(){
    window.print();
    setTimeout(window.close,1000);
});
</script>